package com.snlp.ui;

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.FlowLayout;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JTable;
import javax.swing.JEditorPane;
import javax.swing.JButton;
import net.miginfocom.swing.MigLayout;
import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MainWindow {

	private JFrame frame;
	private JTable table;

	// Create columns names
			String columnNames[] = { "Column 1", "Column 2", "Column 3" };

			// Create some data
			String dataValues[][] =
			{
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" },
				{ "279", "9033", "3092" },
				{ "12", "234", "67" },
				{ "-123", "43", "853" },
				{ "93", "89.2", "109" }
			};
			
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainWindow window = new MainWindow();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainWindow() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 731, 493);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JMenuBar menuBar = new JMenuBar();
		frame.setJMenuBar(menuBar);
		
		JMenu mnFile = new JMenu("File");
		menuBar.add(mnFile);
		
		JMenuItem mntmAbout = new JMenuItem("About");
		mnFile.add(mntmAbout);
		
		JMenuItem mntmQuit = new JMenuItem("Quit");
		mnFile.add(mntmQuit);
		
		JMenu mnSetting = new JMenu("Setting");
		menuBar.add(mnSetting);
		frame.getContentPane().setLayout(new MigLayout("", "[grow]", "[200!][grow][]"));
		
		JScrollPane scrollPane_1 = new JScrollPane();
		frame.getContentPane().add(scrollPane_1, "cell 0 0,growx");
		
		table = new JTable(dataValues, columnNames);
		scrollPane_1.setViewportView(table);
		
		JScrollPane scrollPane = new JScrollPane();
		frame.getContentPane().add(scrollPane, "cell 0 1,grow");
		
		JEditorPane editorPane = new JEditorPane();
		scrollPane.setViewportView(editorPane);
		
		JButton btnNewButton = new JButton("Do this part");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		frame.getContentPane().add(btnNewButton, "cell 0 2, grow");
		
	}

}
